package App.Model.Task;

import App.Model.BaseEnum;

/**
 * Created by xw on 2018/12/17.
 */
public class TaskReminder {

    private String recid;

    //重复方式
    private int repeattype;

    //提前时间的类型：时，分，秒，天，
    private int aheadtype;

    //提前的值
    private int aheadvalue;

    //创建人
    private  int creator;

    public String getRecid() {
        return recid;
    }

    public void setRecid(String recid) {
        this.recid = recid;
    }

    public int getRepeattype() {
        return repeattype;
    }

    public void setRepeattype(int repeattype) {
        this.repeattype = repeattype;
    }

    public int getAheadtype() {
        return aheadtype;
    }

    public void setAheadtype(int aheadtype) {
        this.aheadtype = aheadtype;
    }

    public int getAheadvalue() {
        return aheadvalue;
    }

    public void setAheadvalue(int aheadvalue) {
        this.aheadvalue = aheadvalue;
    }

    public int getCreator() {
        return creator;
    }

    public void setCreator(int creator) {
        this.creator = creator;
    }

    public  String calAheadType(){
        if(BaseEnum.TaskAheadType.Second.getTaskAheadType() == aheadtype){
            return String.format("%s秒", aheadvalue);
        }else if(BaseEnum.TaskAheadType.Minute.getTaskAheadType() == aheadtype){
            return String.format("%s分钟", aheadvalue);
        }else if(BaseEnum.TaskAheadType.Hour.getTaskAheadType() == aheadtype){
            return String.format("%s小时", aheadvalue);
        }else if(BaseEnum.TaskAheadType.Day.getTaskAheadType() == aheadtype){
            return String.format("%s天", aheadvalue);
        }else if(BaseEnum.TaskAheadType.Week.getTaskAheadType() == aheadtype){
            return String.format("%s周", aheadvalue);
        }else if(BaseEnum.TaskAheadType.Month.getTaskAheadType() == aheadtype){
            return String.format("%s月", aheadvalue);
        }else if(BaseEnum.TaskAheadType.Year.getTaskAheadType() == aheadtype){
            return String.format("%s年", aheadvalue);
        }
        return "";
    }
}



